package cn.tedu.csmall.pageinfo.service.impl;

import cn.tedu.csmall.commons.pojo.order.model.Order;
import cn.tedu.csmall.pageinfo.mapper.OrderMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class OrderServiceImpl {

    @Autowired
    private OrderMapper orderMapper;

    public PageInfo<Order> getAllOrdersByPage(Integer pageNum,Integer pageSize){
        PageHelper.startPage(pageNum,pageSize);
        List<Order> list = orderMapper.findAllOrders();
        return new PageInfo<>(list);
    }

}
